package com.quan.system.service.impl;

import java.io.Serializable;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.quan.common.core.MyBaseServiceImpl;
import com.quan.system.entity.SystemRolePermission;
import com.quan.system.mapper.SystemRolePermissionMapper;
import com.quan.system.service.SystemRolePermissionService;

/**
 * <p>
 * 系统-角色与(菜单)权限关联 服务实现类
 * </p>
 *
 * @author 杨浩泉
 * @since 2019-06-06
 */
@Service
public class SystemRolePermissionServiceImpl extends MyBaseServiceImpl<SystemRolePermissionMapper, SystemRolePermission> implements SystemRolePermissionService {
	
	@Override
	public void deleteByRoleId(Serializable roleId) {
		QueryWrapper<SystemRolePermission> queryWrapper = new QueryWrapper<SystemRolePermission>();
		queryWrapper.eq("role_id", roleId);
		
		super.remove(queryWrapper) ;
	}
	
	@Override
	public void deleteByMenuId(Serializable menuId) {
		QueryWrapper<SystemRolePermission> queryWrapper = new QueryWrapper<SystemRolePermission>();
		queryWrapper.eq("menu_id", menuId);
		super.remove(queryWrapper) ;
	}

}
